Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: clarify bufferline-custom-areas #900

Closed
wants to merge 1 commit into from
Closed

doc: clarify bufferline-custom-areas #900

wants to merge 1 commit into from

Conversation

thisfoxcodes
Copy link

Update text in bufferline-custom-areas section.

There is an unexplained issue or nuance with the given custom-area example. It is possible for errors to appear with warning/info/hint (or any diagnostic level under any highlight group) due to the way highlight groups are created.

Highlight groups are created on first pass in L21 of method create_hl It is important to note that they are not unset.

For example, if the first diagnostic is a hint, then highlight group BufferLineRightCustomAreaText1 will be the hint highlight group. Then, if you fix the hint and introduce an error diagnostic, it will appear with the hint highlighting.

One solution would be to unset highlight groups and then re-set them during method call. Destroying and creating the highlight groups each time tabline is rendered sounds like an expensive solution.

One workaround is to create the table entries with desired highlights so the BufferLine[side]CustomAreaTest[number] groups and insert the text if needed.

@gepbird
Copy link
Contributor

gepbird commented Jul 19, 2024

I've encountered this issue as well and made a different workaround: 9fedfd1 (merged in f98ede0).

@thisfoxcodes thisfoxcodes deleted the fix-custom-areas-documentation branch July 25, 2024 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants